package model;

/**
 *
 * @author Sonny Sandberg
 */
public class GraveYard 
{
    private int id;
    private String name;
    private Address address;

    public GraveYard(int id, String name, Address address)
    {
        this.id = id;
        this.name = name;
        this.address = address;
    }

    public GraveYard()
    {   
        address = new Address();
        reset();
    }
    
    public void reset()
    {
        id = 0;
        name = "";
        address.reset();
    }
    
    public boolean isCompleted()
    {
        boolean answer = false;
        if (name.length() > 0)
        {
            answer = true;
        }
        return answer;
    }

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public Address getAddress()
    {
        return address;
    }

    public void setAddress(Address address)
    {
        this.address = address;
    }
    
    public String toString()
    {
        String text = "";
        
        text = String.format("ID: %d\nNavn: %s\n%s", id, name, address.toString());
        
        return text;
    }
}
